<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    var arr=[23,13,132,23,34,545,566,67,34,78,57];
    //one
    Array.prototype.qc1=function(){
        //定义一个临时数组
        var n=[];
        for(var i=0;i<this.length;i++){
            if(n.indexOf(arr[i])==-1){
               n.push(arr[i])
            }
        }
        return n;
    }
    console.log(arr.qc1());

    //two
    Array.prototype.qc2=function(){

        var n=[this[0]];
        for(var i=0;i<this.length;i++){
            if(n.indexOf(arr[i])==-1){
               n.push(arr[i])
            }
        }
        return n;
    }
    console.log(arr.qc2());
</script>
</body>
</html>